% TEST_ID: LANG-EXPAND-0086
% CATEGORY: stdlib/arithmetic_ops/triangle
% 测试 三角函数

function test_asec_asecd_asech()
assert(round(asec(3), 15) == 1.230959417340775)
% assert(round(asec(0.5), 15) == 1.316957896924817i)
assert(abs(real(asec(0.5))) < 1e-12 && abs(imag(asec(0.5)) - 1.316957896924817) < 1e-12)
% assert(round(asec(-0.5), 15) ==  3.141592653589793 - 1.316957896924817i)
assert(abs(real(asec(-0.5)) - 3.141592653589793) < 1e-12 && abs(imag(asec(-0.5)) + 1.316957896924817) < 1e-12)
assert(round(asec(2+2i), 15) == 1.326274161659357 + 0.254895573340551i)

% assert(round(asecd(3), 15) == 70.528779365509322)
assert(abs(asecd(3)) - 70.528779365509322 < 1e-12)
% assert(round(asecd(0.5), 15) == 0.000000000000000 +75.456129290216893i)
assert(abs(real(asecd(0.5))) < 1e-12 && abs(imag(asecd(0.5)) - 75.456129290216893) < 1e-12)
% assert(round(asecd(-0.5), 15) ==  1.800000000000000e+02 - 7.545612929021689e+01i)
assert(abs(real(asecd(-0.5)) -180.0) < 1e-12 && abs(imag(asecd(-0.5)) + 75.456129290216893) < 1e-12)
% assert(round(asecd(2+2i), 15) ==  75.989911940332590 + 14.604440568980905i)
assert(abs(real(asecd(2+2i)) - 75.989911940332590) < 1e-12 && abs(imag(asecd(2+2i)) - 14.604440568980905) < 1e-12)

assert(round(asech(0.5), 15) ==  1.316957896924817)
% assert(round(asech(3), 15) == 1.230959417340775i)
assert(abs(real(asech(3))) < 1e-12 && abs(imag(asech(3)) - 1.230959417340775) < 1e-12)
% assert(round(asech(2 + 2i), 15) == 0.254895573340551 - 1.326274161659357i)
assert(abs(real(asech(2+2i)) - 0.254895573340551) < 1e-12 && abs(imag(asech(2+2i)) + 1.326274161659357) < 1e-12)
